<admintpl file="header"/>
<script type="text/javascript" src="__PUBLIC__/js/jquery.cityselect.js"></script>
</head>
<style>
	.wrap,#myform,.form-group{
		overflow: hidden;
		margin-bottom:10px;
	}
	.wrap,#myform,.form-group label{
		margin-right:10px;
	}
	.radio-inline{
		vertical-align: middle;
		height: 30px;
		line-height:30px;
	}
	.radio-inline input{
		float: left;
		margin-top: 8px;
	}
</style>
<body>
<div class="wrap">
    <form method="post" role="form" class="form-horizontal " id="myform"  action="{:U('Admin/HwbPool/doAddRecord')}">
		<div class="form-group">
			<label class="col-sm-2 control-label">类型</label>
			<label class="radio-inline">
				<input type="radio" id="type" name="type" value="1" checked>
				<span>增加</span>
			</label>
			<!--<label class="radio-inline">
				<input type="radio" name="optionsRadiosinline" id="optionsRadios4"  value="option2"> 选项 2
			</label>-->
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">汇闻币</label>
			<div class="col-sm-10">
				<input type="number" class="form-control" id="huiwenbi" name="huiwenbi" placeholder="输入要调整的汇闻币">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label">备注</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="remarks" name="remarks" placeholder="">
			</div>
		</div>

		<div class="form-actions" style="padding-left:260px;">
			<a class="btn btn-primary" id="ajaxform">提 交</a>
			&nbsp;&nbsp;<a class="btn" id="ajaxback">{:L('BACK')}</a>
		</div>
    </form>

</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript"
        src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
// ajax 提交表单
$(document).ready(function(){
    $("#ajaxform").click(function(){    // 提交按钮触发事件
        var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址

		var type  = $("#type").val();
		var huiwenbi = $("#huiwenbi").val();
		var remarks  = $("#remarks").val();
		if(!type || !huiwenbi){
            parent.layer.msg('请输入汇闻币',{time:2000},1,function(a){

                }
            );
            return;
		}

        $.post(tourl,{type: type, huiwenbi: huiwenbi, remarks:remarks},function(result){
			if(result == '1'){
				var msg = '添加成功';
			}else{
				var msg = '添加失败';
			}

			parent.layer.msg(msg,{time:2000},1,function(a){

				}
			);
			setTimeout(function(){
				var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
				parent.layer.close(index);
			}, 1000);
          });
    });
    $("#ajaxback").click(function(){
    	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
		parent.layer.close(index);
    });
});
</script>
</body>
</html>